﻿<local:DialogBase x:Class="Daytimer.Dialogs.Error" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:Daytimer.Dialogs"
		Title="Oops..." Width="476" MinHeight="230" ResizeMode="NoResize" IsTitleVisible="False"
		WindowStartupLocation="CenterOwner" ShowInTaskbar="False" SizeToContent="Height" Loaded="window_Loaded">
	<Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
			<RowDefinition Height="*" />
			<RowDefinition Height="Auto" />
		</Grid.RowDefinitions>
		<TextBlock Grid.Column="1" Foreground="{DynamicResource DialogTitle}" FontSize="29" Margin="25,0,25,10"
				TextWrapping="Wrap"
				Text="{Binding Title, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}, FallbackValue=Oops...}" />
		<TextBlock Foreground="{DynamicResource DialogContent}" FontSize="15" Grid.Column="1" Grid.Row="1"
				Margin="25,15,25,15" TextWrapping="Wrap"
				Text="We ran into a problem. Your work has been saved, and you can recover your documents after Dimension 4 restarts." />
		<Expander x:Name="detailsExpander" Grid.Row="2" Grid.ColumnSpan="2" Margin="25,50,0,-25" Header="_Details"
				VerticalAlignment="Bottom">
			<Expander.Template>
				<ControlTemplate TargetType="{x:Type Expander}">
					<Grid>
						<Grid.RowDefinitions>
							<RowDefinition Height="Auto" />
							<RowDefinition Height="*" />
						</Grid.RowDefinitions>
						<ToggleButton x:Name="HeaderSite" ContentTemplate="{TemplateBinding HeaderTemplate}"
								Content="{TemplateBinding Header}"
								IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
								Margin="1" MinWidth="0" MinHeight="0" Padding="{TemplateBinding Padding}"
								VerticalContentAlignment="Center" HorizontalAlignment="Left">
							<ToggleButton.FocusVisualStyle>
								<Style>
									<Setter Property="Control.Template">
										<Setter.Value>
											<ControlTemplate>
												<Rectangle Margin="0" SnapsToDevicePixels="True" Stroke="Black"
														StrokeThickness="1" StrokeDashArray="1 2" />
											</ControlTemplate>
										</Setter.Value>
									</Setter>
								</Style>
							</ToggleButton.FocusVisualStyle>
							<ToggleButton.Style>
								<Style TargetType="{x:Type ToggleButton}">
									<Setter Property="Template">
										<Setter.Value>
											<ControlTemplate TargetType="{x:Type ToggleButton}">
												<Grid Background="Transparent" SnapsToDevicePixels="False">
													<Grid.ColumnDefinitions>
														<ColumnDefinition Width="19" />
														<ColumnDefinition Width="*" />
													</Grid.ColumnDefinitions>
													<Ellipse x:Name="circle" Fill="White" HorizontalAlignment="Center"
															Height="19" Stroke="#FF333333" VerticalAlignment="Center"
															Width="19" IsHitTestVisible="False" />
													<Path x:Name="arrow" Data="M1,1.5L4.5,5 8,1.5"
															HorizontalAlignment="Center" SnapsToDevicePixels="False"
															Stroke="#FF333333" StrokeThickness="2"
															VerticalAlignment="Center" IsHitTestVisible="False" />
													<ContentPresenter Content="{TemplateBinding Content}"
															Grid.Column="1" HorizontalAlignment="Left" Margin="4,0,0,1"
															RecognizesAccessKey="True" SnapsToDevicePixels="True"
															VerticalAlignment="Center" />
												</Grid>
												<ControlTemplate.Triggers>
													<Trigger Property="IsChecked" Value="True">
														<Setter Property="Data" TargetName="arrow"
																Value="M 1 4.5 4.5 1 8 4.5" />
													</Trigger>
													<Trigger Property="IsMouseOver" Value="True">
														<Setter Property="Stroke" TargetName="circle" Value="#FF5593FF" />
														<Setter Property="Fill" TargetName="circle" Value="#FFF3F9FF" />
														<Setter Property="Stroke" TargetName="arrow" Value="Black" />
													</Trigger>
													<Trigger Property="IsPressed" Value="True">
														<Setter Property="Stroke" TargetName="circle" Value="#FF3C77DD" />
														<Setter Property="StrokeThickness" TargetName="circle"
																Value="1.5" />
														<Setter Property="Fill" TargetName="circle" Value="#FFD9ECFF" />
														<Setter Property="Stroke" TargetName="arrow" Value="Black" />
													</Trigger>
													<Trigger Property="IsEnabled" Value="False">
														<Setter Property="Stroke" TargetName="circle" Value="#FFBCBCBC" />
														<Setter Property="Fill" TargetName="circle" Value="#FFE6E6E6" />
														<Setter Property="Stroke" TargetName="arrow" Value="#FF707070" />
													</Trigger>
												</ControlTemplate.Triggers>
											</ControlTemplate>
										</Setter.Value>
									</Setter>
								</Style>
							</ToggleButton.Style>
						</ToggleButton>
						<ContentPresenter x:Name="ExpandSite" Content="{TemplateBinding Content}" Grid.Row="1"
								Focusable="False" Margin="{TemplateBinding Padding}" Visibility="Collapsed" />
					</Grid>
					<ControlTemplate.Triggers>
						<Trigger Property="IsExpanded" Value="True">
							<Setter Property="Visibility" TargetName="ExpandSite" Value="Visible" />
						</Trigger>
						<Trigger Property="IsEnabled" Value="False">
							<Setter Property="Foreground"
									Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Expander.Template>
			<Grid>
				<Grid.RowDefinitions>
					<RowDefinition />
					<RowDefinition Height="Auto" />
				</Grid.RowDefinitions>
				<ScrollViewer x:Name="stackTraceScroller" Margin="2,15,25,35" VerticalScrollBarVisibility="Auto"
						Focusable="False">
					<TextBlock x:Name="stackTrace" TextWrapping="Wrap" IsHitTestVisible="False" />
				</ScrollViewer>
				<Button x:Name="ignoreButton" Grid.Row="1" Content="Ignore" HorizontalAlignment="Left"
						Style="{StaticResource LinkText}" Foreground="{DynamicResource LinkTextForeground}"
						Click="ignoreButton_Click" />
			</Grid>
		</Expander>
		<Grid Grid.Row="3" Grid.ColumnSpan="2" VerticalAlignment="Bottom" Margin="0,0,14,14">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="Auto" />
				<ColumnDefinition Width="*" />
				<ColumnDefinition Width="Auto" />
			</Grid.ColumnDefinitions>
			<Button x:Name="okButton" Grid.Column="1" Content="_Submit an error report" HorizontalAlignment="Right"
					Margin="0,0,9,0" IsDefault="True" Width="Auto" Padding="10,0" Height="25" Click="okButton_Click" />
			<Button x:Name="cancelButton" Grid.Column="2" Content="_Restart" HorizontalAlignment="Right"
					Margin="0,0,9,0" Height="25" IsCancel="True" />
		</Grid>
	</Grid>
</local:DialogBase>
